<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>图书管理</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body bgcolor="#cbeeeb">
		<%@include file="header.jsp"%>
		<% if (request.getSession().getAttribute("user")==null){
	response.sendRedirect(request.getContextPath()+"/login.jsp");
};
 %>
		
		<hr>
		<h1>
			图书查询
		</h1>
		<form action="book!queryBy" method="post">
			<input type="text" name="book.bname" value="请输入书名"
				onclick="if(value==defaultValue){value='';this.style.color='#000'}"
				onBlur="if(!value){value=defaultValue;this.style.color='#999'}"
				style="color: #999">
			<input type="submit" value="查询">
		</form>
		这是第${pages.beginIndex+1 }－${pages.endIndex}本书 共${pages.totalCount }本书
		<table>
			<tr>
				<td>
					书编号
				</td>
				<td>
					ISBN
				</td>
				<td>
					书名
				</td>
				<td>
					作者
				</td>
				<td>
					库存数量
				</td>
				<td>
					出版社
				</td>
				<td>
					价格
				</td>
				<td>
					入库时间
				</td>
				<td colspan="2">
					操作
				</td>
			</tr>
			<s:iterator var="list" value="list">
				<form  action="book!update" method="post" name="form1">
					<tr>
						<td>
							<s:property value="#list.bid"></s:property>
							<input type="hidden" value="${list.bid }" name="book.bid">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.isbn"></s:property>
								name="book.isbn">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.bname"></s:property>
								name="book.bname">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.compile"></s:property>
								name="book.compile">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.count"></s:property>
								name="book.count">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.press"></s:property>
								name="book.press">
						</td>
						<td>
							<input type="text"
								value=<s:property value="#list.price"></s:property>
								name="book.price">
						</td>
						<td>
							<s:property value="#list.time"></s:property>
						</td>
						<td>
							<input type="submit" value="修改">
						</td>
						<td>
							<a href="book!delete?book.bid=${list.bid }"> 删除</a>
						</td>
					</tr>
				</form>
			</s:iterator>
		</table>
		<span style="color: red">${a}</span>
		<br>
		第${pages.currentPage }页/共${pages.totalPage }页
		<a href="book!query?page.currentPage=1">首页</a>
		<a href="book!query?page.currentPage=${pages.currentPage-1 }">上一页</a>
		<a href="book!query?page.currentPage=${pages.currentPage+1 }">下一页</a>
		<a href="book!query?page.currentPage=${pages.totalPage}">尾页</a>
		<form action="book!add" method="post">
			ISBN:
			<input type="text" name="book.isbn">
			* 书名：
			<input type="text" name="book.bname">
			* 作者：
			<input type="text" name="book.compile">
			数量：
			<input type="text" name="book.count">
			* 出版社：
			<input type="text" name="book.press">
			价格：
			<input type="text" name="book.price">
			<input type="submit" value="增加">
			<span style="color: red">${msg}</span>

		</form>
</html>
